home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / dvglue.arc / DVINIT.C < prev    next >
C/C++ Source or Header  |  1990-01-09  |  2KB  |  68 lines

  1. /*=======================================================*/
  2. /*  DVINIT.C                                             */
  3. /*     initialize/exit API interface                     */
  4. /*                                                       */
  5. /*  (c) Copyright 1988 Ralf Brown  All Rights Reserved   */
  6. /*  May be freely copied for noncommercial use, so long  */
  7. /*  as this copyright notice remains intact, and any     */
  8. /*  changes are marked in the comment blocks preceding   */
  9. /*  functions.                                           */
  10. /*=======================================================*/
  11.  
  12. #include "tvapi.h"
  13.  
  14. /*=======================================================*/
  15. /* DVinit   initialize DESQview API interface, and       */
  16. /*          return version (0 if DV not loaded)          */
  17. /*   Ralf Brown 4/23/88                                  */
  18. /*=======================================================*/
  19.  
  20. int pascal DVinit(void)
  21. {
  22.    int version ;
  23.  
  24.    TVinit() ;
  25.    _AX = 0x2B01 ;
  26.    _CX = 0x4445 ;
  27.    _DX = 0x5351 ;
  28.    geninterrupt(0x21) ;
  29.    if (_AX == 2)
  30.       version = 0x0200 ;
  31.    else
  32.       {
  33.       version = _AH ;
  34.       version += (_AL << 8) ;
  35.       }
  36.    if (version != 0)
  37.       {
  38.       _BX = 0x0200 ;  /* set minimum required API level to 2 */
  39.       _AX = 0x110B ;
  40.       geninterrupt(0x15) ;
  41.       if (_AX == 0x0002)
  42.          {
  43.          _BX = 0x0002 ;
  44.          _AX = 0x110B ;
  45.          geninterrupt(0x15) ;
  46.          }
  47.       }
  48.    if (version > 0x200)
  49.       {
  50.       /* v2.01-specific API call */
  51.  
  52.       }
  53.    return version ;
  54. }
  55.  
  56. /*=======================================================*/
  57. /* DVexit   exit DESQview API interface                  */
  58. /*   Ralf Brown 4/23/88                                  */
  59. /*=======================================================*/
  60.  
  61. void pascal DVexit(void)
  62. {
  63.    TVexit() ;
  64.    /* currently nothing else to do */
  65. }
  66.  
  67. /* End of DVINIT.C */
  68.